/*
 * @Author: guxf
 * @Date: 2021-11-25 12:47:22
 * @Description: 货品相关接口
 */
import request from "@/utils/request.js";
const api = {
  getAll: '/applet/goods/getAll',
  getGoods: '/applet/goods/selectGoodsList',
  getGoodsById: '/applet/goods/getGoodsById/',
  getGoodsByIds: '/applet/goods/getGoodsByIds/',
  getGoodsByKeyword: '/applet/goods/getGoodsByKeyword',
}
export function page(data) {
  return request({
    url: "/applet/goods/page",
    method: 'POST',
    data
  })
}

export function getGoodsById(id) {
  return request({
    url: "/applet/goods/"+id,
    method: 'GET'
  })
}

export function getAll() {
	return request({
		url: api.getAll,
		method: 'get',
	})
}

export function getGoods(parameter) {
  return request({
    url: api.getGoods,
    method: 'post',
    data: parameter
  })
}

export function getGoodsByKeyword(parameter) {
  return request({
    url: api.getGoodsByKeyword,
    method: 'post',
    data: parameter
  })
}

// 首页获取部分商品
export function getSomeGoods(parameter) {
  return request({
    method: "GET",
    url: '/applet/goodsType/getGoodsTypeList',
  });
}
// 获取推荐商品
export function getAdGoods(parameter) {
  return request({
    method: "GET",
    url: '/applet/goods/getGoods',
  });
}
